#include <iostream>
#include <fstream>
using namespace std;

int a[16] = {23,40,17,34,67,18,55,32,12,18,20,23,17,40,40,55};
int n=16;

int search(int p, int q, int x)
{ for(int i=p; i<=q; i++)
    if(x==a[i]) return i;
  return -1;
}    

int main()
{ int x;
  do
  { cin >> x;
    int p = search(0,n-1,x);
    cout << p << endl;
  } while(x>=0);
    
  
  return 0;
}
  


